﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for AddressBAL
/// </summary>
public class AddressBAL
	{
	private AddressDAL _addressDal;

	public AddressBAL() : this(new AddressDAL()) { }
	public AddressBAL(AddressDAL addressDal) { _addressDal = addressDal; }


	public int InsertAddress(AddressBO Address)
	{
		try
			{
			return _addressDal.CreateAddress(Address);
			}
		catch (Exception ex)
			{
			throw ex;
			}
		finally
			{
			_addressDal = null;
			}
	}

	public int UpdateAddress(AddressBO Address)
	{
		try
			{
			return _addressDal.UpdateAddress(Address);
			}

		catch
			{
			throw;
			}

		finally
			{
			_addressDal = null;
			}

	}
	public DataTable AddressDisplay()
	{


		try
			{
			return _addressDal.Load();
			}

		catch
			{
			throw;
			}

		finally
			{
			_addressDal = null;
			}

	}
	public int DeleteAddress(AddressBO Address)
    {
		try
			{
			return _addressDal.DeleteAddress(Address);
			}

		catch
			{
			throw;
			}

		finally
			{
			_addressDal = null;
			}

		}
	}